package com.wei.controller;

import java.io.IOException;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StopWatch;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.wei.service.InformationService;
import com.wei.util.ExcelUtils;

@RestController
@RequestMapping("/file")
public class InfomationController {
	
	@Autowired
	private InformationService InformationService;
	
	@Autowired
	private ExcelUtils excelUtils;
	
	/**
	 * 分批次导出
	 */
	@GetMapping("/export")
	public void export(HttpServletResponse response) throws IOException {
	    StopWatch stopWatch = new StopWatch();
	    stopWatch.start();
	    excelUtils.dataExport300w(response);
	    stopWatch.stop();
	    System.out.println("共计耗时： " + stopWatch.getTotalTimeSeconds()+"S");
	}
}
